package com.kpmg.datalake.common.enums;

/**
 * @author Alex.zhao [alex.zhao@kpmg.com]
 * @since Created on azhao6 on 2018-08-06 13:10:20
 */
public enum ReportTypeEnum {
    /**
     * 报表类型：科目余额
     */
    SUBJECT_BALANCE("subjectBalance", "科目余额"),
    /**
     * 报表类型：序时账
     */
    JOURNAL("journal", "序时账"),
    /**
     * 报表类型：科目余额
     */
    SUBJECT_BALANCE_VBA("subjectBalanceVba", "科目余额vba"),
    /**
     * 报表类型：序时账
     */
    JOURNAL_VBA("journalVba", "序时账vba"),
    /**
     * AllBookSet
     */
    ALL_BOOK_SET("AllBookSet", "项目总账套"),
    /**
     * journalIR
     */
    JOURNAL_IR("journalIR", "内部对账明细钻取");

    private String code;
    private String display;

    ReportTypeEnum(String code, String display) {
        this.code = code;
        this.display = display;
    }

    /**
     * 通过编码获取对应的中文
     *
     * @param code code
     * @return String
     */
    public static String getDisplayByCode(String code) {
        for (ReportTypeEnum reportTypeEnum : ReportTypeEnum.values()) {
            if (reportTypeEnum.code.equals(code)) {
                return reportTypeEnum.display;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDisplay() {
        return display;
    }

    public void setDisplay(String display) {
        this.display = display;
    }
}
